package com.bridgeQQ.client.util
{
	import com.bridgeQQ.client.model.BridgeModel;
	
	import mx.messaging.messages.AsyncMessage;
	import mx.messaging.messages.IMessage;
	import mx.utils.UIDUtil;
	
	public class MessageUtil
	{
		public static function  createMessage(body:String, destionation:String, type:String):IMessage
		{
			var message:IMessage = new AsyncMessage();
			message.body.chatMessage = body;
			message.headers.destination = destionation;
			message.headers.type =  type;
			message.timestamp = new Date().time;
			message.headers.from = BridgeModel.instance.user.email;
			//message.messageId = message.headers.from + message.timestamp;
			return message;
		}
		
		
		public static function createAddFriendReplyMessage(body:String, destionation:String, 
		    type:String, agree:Boolean):IMessage
		{
			var msg:IMessage = createMessage(body, destionation ,type);
			msg.headers.agree = agree;
			return msg;
		}
	}
}